{* $Id$ *}
{include_core file="admin/lib/header.html" title="任务专题列表"}
<div class="page-header border-bottom clearfix">
    <h2 class="left">专题列表</h2>
    <a href='{AnUrl("topic/admin/job/add")}' class="btn btn-success btn-sm right"><i
            class="icon-add"></i>添加任务专题</a>
</div>
<!--start:列表-->
{include_core file="admin/lib/pager.html"}
<table class="list-table">
    <thead>
    <tr>
        <th style="width:30px">编号</th>
        <th>名称</th>
        <th>活动日期</th>
        <th>状态</th>
        <th>说明</th>
        <th style="width:200px">限制条件</th>
        <th>添加时间</th>
        <th style="width:100px">操作</th>
    </tr>
    </thead>
    <tbody>
    {foreach $job_list as $k => $v}
    <tr>
        <td>{$v.id}</td>
        <td>{$v.name}</td>
        <td>{$v.start_date} ~ {$v.end_date}</td>
        <td>
            {if $v.status==0}
            <span class="label label-default">{topic_config::$STATUS[$v.status]}</span>
            {elseif $v.status==1}
            <span class="label label-info">{topic_config::$STATUS[$v.status]}</span>
            {elseif $v.status==2}
            <span class="label label-success">{topic_config::$STATUS[$v.status]}</span>
            {/if}
        </td>
        <td>
            <p>{$v.info}</p>
        </td>
        <td>
            {if $v.term}
            {if $v.term.agency_ids}
            <fieldset>
                <legend>合伙人</legend>
                <ul style="height:4em;overflow:hidden;overflow-y:auto;">
                    {foreach $v.term.agency_ids as $agency_name}
                    <li>{$agency_name}</li>
                    {/foreach}
                </ul>
            </fieldset>
            {/if}
            {/if}
        </td>
        <td>{$v.add_time}</td>
        <td>
            <a href='{AnUrl("topic/admin/job/edit?id={$v.id}")}' class="btn btn-success btn-xs js_edit"><i
                    class="icon-trash icon-white"></i>编辑</a>
            <a href='{AnUrl("topic/admin/job/delete?id={$v.id}")}' class="btn btn-danger btn-xs js_delete"><i
                    class="icon-trash icon-white"></i>删除</a>
        </td>
    </tr>
    {foreachelse}
    <tr>
        <td class="txtleft" colspan="5">暂无数据</td>
    </tr>
    {/foreach}
    </tbody>
</table>
<script>
    (function ($) {
        $('.list-table').on('click', '.js_delete', function (e) {
            e.preventDefault();
            var el = $(this);
            showConfirm('删除这个活动?', 1, function () {
                window.location = el.attr('href');
            });
        });
    })(jQuery);
</script>
{include_core file="admin/lib/pager.html"}
<!--end:列表-->
{include_core file="admin/lib/footer.html"}